package com.qingke.factory;

import com.qingke.command.Command;
import com.qingke.pojos.Customer;
import com.qingke.pojos.User;

public abstract class AbstractCommandFactory {
	public static AbstractCommandFactory getFactory(Object obj){
		if(obj instanceof User){
			User user = (User)obj;
			return new UserCommandFactory(user);
		}
		
		if(obj instanceof Customer){
			Customer customer = (Customer)obj;
			return new CustomerCommandFactory(customer);
		}
		return null;
	}
	
	public abstract Command getCommand(String cmd);
		

}
